<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="sealte.hvpms.pojo.*,sealte.hvpms.util.HVPMSTools" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	UserCreate uc = (UserCreate)session.getAttribute("UserCreate");
	if(uc!=null){
%>
<%
	String fid_str = request.getParameter("fid");
	if(fid_str!=null&&!fid_str.equals("")&&HVPMSTools.isNum(fid_str)){
		int id = Integer.parseInt(fid_str);
%>
<html>
<head>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>仓鼠网上投票系统HVPMS</title>
<link href="css/vp_res_view.jsp.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
	$('#barChart').show();
	$('#pieChart').hide();
});
function showChart(num){
	if(num==1){
		$('#barChart').show();
		$('#pieChart').hide();
	}else if(num==2){
		$('#barChart').hide();
		$('#pieChart').show();
	}
}
function getback(){
	window.location.href = "<%=basePath%>home/vp_res_management.jsp";
}
</script>
</head>
<body>
<div id="num2">
	<h2><img src="images/chart_bar.png">&nbsp;投票结果管理-查看</h2>
</div>

<div id="num1">
<table>
<tr>
	<td align="left">
		<input type="button" value="柱状图" onclick="showChart(1)">
		<input type="button" value="饼状图" onclick="showChart(2)">
		<input type="button" value="返回" onclick="getback()">
	</td>
</tr>
</table>
</div>
<div id="num3">
	<div id="barChart">
		<img src="GetVPsBarChart?id=<%=id %>" />
	</div>
	<div id="pieChart">
		<img src="GetVPsPieChart?id=<%=id %>" />
	</div>
</div>
</body>
</html>
<%	
	}else{
		out.println("出错了。。。");
	}
%>
<%		
	}else{
		out.println("谢绝跨路径访问！");
	}
%>